#include <iostream>
#include <memory>
#include <string>

using namespace std;

/*
\ brief:  用户
\ author: 清晨与猫鱼
*/
class User {

/* 
\ brief:  内部类 聊天房间
\ author: 清晨与猫鱼
*/
    class ChatRoom {
    public:
        static void showMessage(User& user, const string& message) {
            cout << " [" << user.getName() << "] : " << message << endl;
        }
    };
public:

    explicit User(string name)
        : name_(move(name)) {
    }

    void setName(string name) {
        name_ = move(name);
    }

    string& getName() {
        return name_;
    }

/*
\ brief:  发送消息到聊天房间
\ author: 清晨与猫鱼
*/
    void sendMessage(string message) {
        ChatRoom::showMessage(*this, message);
    }
private:
    string name_;
};